<template>
    <div class="home-swipe">
    <van-search v-model="search" placeholder="请输入搜索关键词"  input-align="center"/>

    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="item in bannerData" :key="item.id">
    <van-image :src="item.picUrl" lazy-load />
    </van-swipe-item>
</van-swipe>
    </div>
</template>
<script>
import {Toast}from 'vant'; 
//import axios from 'axios'
export default {
  data() {
    return {
      search: '',
      bannerData:[]
    };
  },
  created(){
    this.getBanner()
  },
  methods:{
      rch(val){
          Toast(val);
      },
      getBanner(){
       this.$request( "get","/recommend/banner")
       .then(res=>{
         console.log(res)
         if(res.result == 100){
           this.bannerData = res.data
         }
       })
  }
}
}

</script>
<style scoped>
  /* .my-swipe img{
   width:100%;
   border-radus:1rem;
} */
</style>
